package com.coffee.core.enums;

public enum ContractTypeEnum {
    PAYING("paying", "付款凭证"),
    CONTRACT("contract", "签约信息"),
    INVOICE("invoice","发票");

    private String code;
    private String name;

    private ContractTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static ContractTypeEnum getByCode(String code) {
        for (ContractTypeEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }

        return null;
    }
}
